/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86131
 * Date: 2023-11-15
 * Time: 15:12
 */
public class GameTest {
    public static void main(String[] args) {
        //创建2个角色
        Role r1 = new Role("乔峰",100,'男');
        Role r2 = new Role("鸠摩智",100,'男');


        //展示角色信息
        r1.showRoleInfo();
        r2.showRoleInfo();

        //开始格斗
        while(true){
            //r1开始攻击r2
            r1.attack(r2);
            //判断r2剩余血量
            if (r2.getBlood() == 0){
                System.out.println(r1.getName()+"K.O"+r2.getName());
                break;
            }

            //r2开始攻击r1
            r2.attack(r1);
            //判断r1剩余血量
            if (r1.getBlood() == 0){
                System.out.println(r2.getName()+"K.O"+r1.getName());
                break;
            }
        }

    }
}
